<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>快递公司管理</title>
	</head>
	
    <body>
	   <div class="col-md-12">
	      <!-- BEGIN EXAMPLE TABLE PORTLET-->
	      <div class="portlet">
	         <div class="portlet-title">
	            <div class="caption"><i class="icon-edit"></i>快递公司列表</div>
	         </div>
	         <div class="portlet-body">
	         <s:form id="queryFrm" action="list" namespace="/admin/company" method="post" cssClass="form-horizontal">
	         	<s:hidden id="_page" name="page" />
	          </s:form>
	          <div class="clear"></div>
	            <s:if test="%{companies.size >0}">
	            <table class="table table-striped table-hover table-bordered" id="floorTable">
	               <thead>
	                  <tr>
	                     <th>名称</th>
                         <th>操作</th>
	                  </tr>
	               </thead>
	               <tbody>
	               <s:iterator value="companies" >
	                  <tr >
                         <td><s:property value="name" /></td>
                         <td>
	                         <a class="edit" href="<s:url action="edit" namespace="/admin/company" />?id=<s:property value="entityId" />&page=<s:property value="page" />" >编辑</a>
	                         <a class="delete" href="javascript:;" targetId="<s:property value="entityId" />">删除</a>
                         </td>
	                  </tr>
	                  </s:iterator>
	               </tbody>
	            </table>
	            
	            <s:include value="/WEB-INF/jsp/admin/paging-bar.jsp" />
	            </s:if><s:else>
	            <s:include value="/WEB-INF/jsp/admin/empty-record.jsp" >
	            	<s:param name="moduleTitle">快递公司</s:param>
	            </s:include>
	            </s:else>
	         </div>
	      </div>
	      <!-- END EXAMPLE TABLE PORTLET-->
	   </div>
       <script type="text/javascript">
            
       $(document).ready(function() {
           $('#floorTable a.delete').live('click', function (e) {
               
           if (!confirm("您确定要删除该记录？")) {
               return;
           }
           
           var targetId = $(this).attr('targetId');
           var url = '<s:url action="delete" namespace="/admin/company" />?id=' + targetId;
               window.location = url;
           });
           
           TitleActionBar.inertPlusButton("新增快递公司", '<s:url action="add" namespace="/admin/company" />');
           
       });
            
       </script>
</body>
</html>